﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RadioStation.cs" company="">
//   
// </copyright>
// <summary>
//   The radio station.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace TinyRadio.Models
{
    using System.ComponentModel;

    /// <summary>The radio station.</summary>
    public class RadioStation : INotifyPropertyChanged
    {
        #region Fields

        /// <summary>The _enabled.</summary>
        private bool enabled;

        /// <summary>The _id.</summary>
        private string id;

        /// <summary>The _name.</summary>
        private string name;

        /// <summary>The _url.</summary>
        private string url;

        #endregion

        #region Public Events

        /// <summary>The property changed.</summary>
        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region Public Properties

        /// <summary>Gets or sets a value indicating whether enabled.</summary>
        public bool Enabled
        {
            get
            {
                return this.enabled;
            }

            set
            {
                this.enabled = value;
                this.NotifyPropertyChanged("Enabled");
            }
        }

        /// <summary>Gets or sets the id.</summary>
        public string Id
        {
            get
            {
                return this.id;
            }

            set
            {
                this.id = value;
                this.NotifyPropertyChanged("Id");
            }
        }

        /// <summary>Gets or sets the name.</summary>
        public string Name
        {
            get
            {
                return this.name;
            }

            set
            {
                this.name = value;
                this.NotifyPropertyChanged("Name");
            }
        }

        /// <summary>Gets or sets the url.</summary>
        public string Url
        {
            get
            {
                return this.url;
            }

            set
            {
                this.url = value;
                this.NotifyPropertyChanged("Url");
            }
        }

        #endregion

        #region Methods

        /// <summary>The notify property changed.</summary>
        /// <param name="propertyName">The property name.</param>
        private void NotifyPropertyChanged(string propertyName = "")
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}